package step2;

import java.util.ArrayList;
import java.util.Scanner;

public class HelloWorld {

    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        //获取输入的数据并添加至集合
        Scanner sc = new Scanner(System.in);
        ArrayList list = new ArrayList<>();
        int length = sc.nextInt();
        for(int i =0 ; i< length; i++){
            list.add(sc.next());
        }
        /********** Begin *********/
        list.remove(0);
        list.remove(length-1);
        list.add("list");
        list.add("educoder");
        System.out.println(list);





        /********** End **********/
    }
}
